#pragma once
#include <memory.h>
#include <audiere.h>
#include "resource.h"

class Sound : private audiere::File, public Resource
{
	int filePtr;
	audiere::OutputStreamPtr sound;

	ADR_METHOD(int) read(void* buffer, int size);
	ADR_METHOD(bool) seek(int position, audiere::File::SeekMode mode);
	ADR_METHOD(int) tell();

public:

	Sound() : Resource(), filePtr(0) { }

	audiere::OutputStreamPtr getAudiereSound() const { return sound; }

	void ADR_CALL ref() { addRef(); }
	void ADR_CALL unref() { release(); }

private:

	/**
	 * Typ zasobu
	 */
	Type getType() const { return Resource::SoundResource; }

	/**
	 * Laduje zasob.
	 */
	virtual bool load();
	/**
	 * ...
	 */
	virtual void unload();
};